package com.asiainfo.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 
 * @author xw.jiang
 *
 */
public class DateUtils {

	public static void main(String[] args) {
		DateUtils.getFormatterDate("[MMddHHmm]");
	}
	/**
	 * @desc:调用时，给定时间格式，返回调用时new Date()产生的时间值的字符串
	 * @param pattern
	 * @return
	 */
	public static String getFormatterDate(String pattern){
		Date currentTime = new Date();
		SimpleDateFormat formatter = new SimpleDateFormat(pattern);
		String dateString = formatter.format(currentTime);
		//System.out.println(dateString);
		return dateString;
	}
}
